import { defineStore } from 'pinia'
import {useRouter} from "vue-router";
import {ref} from "vue";

export const userStore = defineStore('userStore', () => {
    const isCollapse = ref(false);
    const toggleCollapse = () => {
        isCollapse.value =!isCollapse.value
    }
    const menuList = ref([])
    const getUserMenuList = async () => {
        const router = useRouter();
        menuList.value = router.options.routes[0].children;
    }
    return {
        isCollapse,
        toggleCollapse,
        menuList,
        getUserMenuList
    }
})